//消息盒子
'use strict';
import React,{Component} from 'react';
import Header from '../common/header';
import styles from '../style/styles';
import * as URLconstant from '../constant/URLconstant';
import Util from '../common/util';
import NewsList from './newsList';
import {
    View,
    Image,
    TouchableOpacity,
    Text
} from 'react-native';
export default class newsBox extends Component{
    // 构造
      constructor(props) {
        super(props);
        // 初始状态
        this.state = {};
      }

    toNewsList(title){
        let that = this;
        that.props.navigator.push({
            component:NewsList,
            passProps:{
                title:title
            }
        })
    }

    render(){
        return(
            <View>
                <Header navigator={this.props.navigator}  initObj={{ title:'消息盒子',id:2}}/>
                <TouchableOpacity style={styles.news_box_wrap} onPress={()=>this.toNewsList('物流助手')}>
                    <Image
                        style={styles.news_box_img}
                        resizeMode={'cover'}
                        source={require('../imgs/car.png')}
                    />
                    <View>
                        <Text style={styles.news_box_txt1}>物流助手</Text>
                        <Text numberOfLines={1} style={styles.news_box_txt2}>最新的一条物流信息</Text>
                    </View>
                </TouchableOpacity>
                <TouchableOpacity style={styles.news_box_wrap} onPress={()=>this.toNewsList('通知信息')}>
                    <Image
                        style={styles.news_box_img}
                        resizeMode={'cover'}
                        source={require('../imgs/notice.png')}
                    />
                    <View>
                        <Text style={styles.news_box_txt1}>通知信息</Text>
                        <Text numberOfLines={1} style={styles.news_box_txt2}>最新的一条通知信息</Text>
                    </View>
                </TouchableOpacity>
            </View>
        )
    }
}